package com.zhixing.web.api.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author dzh
 * @version 1.0.0.05020
 * <p>project: d-blog</p>
 * <p>created time: 2022/05/09 15:17</p>
 * <p>describe: 映射配置</p>
 * <p>remarks: </p>
 **/
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Value(value = "${mappingurl.img}")
    String img;

    @Value(value = "${mappingurl.outImg}")
    String outImg;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(outImg + "**").addResourceLocations(img);
    }

}
